#include<stdio.h>
int main()
{
    char a;
    for(;a != '\n';)
    {a = getchar();
        
        switch(a)
        {case 'A': case 'B': case 'C' :
        a = 2; printf("2");break;
        case 'D' : case 'E': case 'F':
        a = 3;printf("3");break;
        case 'G': case 'H': case 'I':
        a = 4;printf("4");break;
        case 'J': case 'K': case 'L':
        a = 5;printf("5");break;
        case 'M': case 'N': case 'O':
        a = 6;printf("6");break;
        case 'P': case 'Q': case 'R': case 'S':
        a = 7;printf("7");break;
        case 'T': case 'U': case 'V':
        a = 8;printf("8");break;
        case 'W': case 'X': case 'Y': case 'Z':
        a = 9;printf("9");break;
        default: printf("%c",a);
		}
       
    }
    return 0;
}